package com.OrderingSystem.controller.seller;


import com.OrderingSystem.pojo.OrderDetail;
import com.OrderingSystem.pojo.OrderMaster;
import com.OrderingSystem.service.IOrderDetailService;
import com.OrderingSystem.utils.Result;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "订单详情接口")
@RestController
@RequestMapping("/seller/order-detail")
@ApiResponses({
        @ApiResponse(code = 200, message = "请求成功",response = Result.class),
        @ApiResponse(code = 403, message = "没有权限"),
        @ApiResponse(code = 404, message = "资源不存在"),
        @ApiResponse(code = 500, message = "服务器错误")
})
public class OrderDetailController {

    @Autowired
    IOrderDetailService orderDetailService;

    @GetMapping("/list")
    public Result selectAllOrderMaster(@RequestParam("orderId") Integer orderId) {
        List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailByOrderId(orderId);
        return Result.success(orderDetails);
    }


}
